using System;
using System.Collections;
using MyFramework;

namespace MIMS.WRS.Entities
{
	/// <summary>
	/// Summary description for ShoppingOrderCollection.
	/// </summary>
		[Serializable]
	public class ShoppingOrderCollection: CollectionBase
	{
			public ShoppingOrder this[ int index ]  
			{
				get  { return( (ShoppingOrder) List[index] ); }
				set  { List[index] = value;  }
			}

			public int Add( ShoppingOrder value )  
			{
				return( List.Add( value ) );
			}

			public int IndexOf( ShoppingOrder value )  
			{
				return( List.IndexOf( value ) );
			}

			public void Insert( int index, ShoppingOrder value ) 
			{
				List.Insert( index, value );
			}

			public void Remove( ShoppingOrder value ) 
			{
				List.Remove( value );
			}

			public bool Contains( ShoppingOrder value ) 
			{
				// If value is not of type ShoppingOrder, this will return false.
				return( List.Contains( value ) );
			}

			protected override void OnInsert( int index, Object value ) 
			{
				if ( value.GetType() != Type.GetType("MIMS.WRS.Entities.ShoppingOrder") )
					throw new ArgumentException("ModelValueMustBeOfTypeShoppingOrderList", "value" );
			}

			protected override void OnRemove( int index, Object value )  
			{
				if ( value.GetType() != Type.GetType("MIMS.WRS.Entities.ShoppingOrder") )
					throw new ArgumentException("ModelValueMustBeOfTypeShoppingOrder", "value" );
			}

			protected override void OnSet( int index, Object oldValue, Object newValue )  
			{
				if ( newValue.GetType() != Type.GetType("MIMS.WRS.Entities.ShoppingOrder") )
					throw new ArgumentException("ModelValueMustBeOfTypeShoppingOrder", "newValue" );
			}

			protected override void OnValidate( Object value )  
			{
				if ( value.GetType() != Type.GetType("MIMS.WRS.Entities.ShoppingOrder") )
					throw new ArgumentException("ModelValueMustBeOfTypeShoppingOrder");
			}
	}
}
